#!/bin/sh
#set -n
set -x
wls_hostname=g1u0754c.austin.hp.com
wls_port=21852
class[0]=com.hp.seeker.sdl.k2.K2SearcherExMainTest
class[1]=com.hp.seeker.sdl.k2.K2SearcherExLaTest
class[2]=com.hp.seeker.sdl.k2.K2SearcherExFTest
class[3]=com.hp.seeker.sdl.k2.K2SearcherExTiTest
class[4]=com.hp.seeker.sdl.k2.K2SearcherExMTest
class[5]=com.hp.seeker.sdl.k2.K2SearcherExTeTest
class[6]=com.hp.seeker.sdl.k2.K2SearcherExBTest
class[7]=com.hp.seeker.sdl.k2.K2SearcherExStTest
class[8]=com.hp.seeker.sdl.k2.K2SearcherExDTest
class[9]=com.hp.seeker.sdl.k2.K2SearcherExLepTest
class[10]=com.hp.seeker.sdl.k2.K2SearcherExLfdTest
class[11]=com.hp.seeker.sdl.k2.K2SearcherExTxTest
class[12]=com.hp.seeker.sdl.k2.K2SearcherExLNullTest
class[13]=com.hp.seeker.sdl.k2.K2SearcherExSuTest
class[14]=com.hp.seeker.sdl.k2.K2SearcherExAUTest
class[15]=com.hp.seeker.cs.service.SearchMdfqTest
class[16]=com.hp.seeker.sdl.k2.K2SearcherExGTest
class[17]=com.hp.seeker.sdl.k2.K2SearcherExQXCR1000784783Test
class[18]=com.hp.seeker.sdl.k2.K2SearcherExQXCR1000784797Test
#class[20]=com.hp.seeker.sdl.k2.K2SearcherExSyEsTest
#class[21]=com.hp.seeker.sdl.k2.K2SearcherExSyItTest
#class[22]=com.hp.seeker.sdl.k2.K2SearcherExSyJaTest
#class[2j]=com.hp.seeker.sdl.k2.K2SearcherExSyJa2Test
#class[23]=com.hp.seeker.sdl.k2.K2SearcherExSyKoTest
#class[24]=com.hp.seeker.sdl.k2.K2SearcherExSyKo2Test
#class[24]=com.hp.seeker.sdl.k2.K2SearcherExSyPtTest
#class[25]=com.hp.seeker.sdl.k2.K2SearcherExSyZhTest
#class[26]=com.hp.seeker.sdl.k2.K2SearcherExSyZtTest
#class[27]=com.hp.seeker.sdl.k2.K2SearcherExSyZt2Test
#class[28]=com.hp.seeker.sdl.k2.K2SearcherExSyDeTest
#class[29]=com.hp.seeker.sdl.k2.K2SearcherExSyFrTest
#class[30]=com.hp.seeker.sdl.k2.K2SearcherExSyEnTest
#class[19]=com.hp.seeker.cs.defects.PageNullCVNodeValuesTest
selected=17
selected=12 # Audit
selected=0 #main
selected=17
selected=
rm -f $ii/whyiu
ic=0
while (( ic < ${#class[*]} )) ; do
if [[ (-z "$selected") || ("$selected" = "$ic") ]] ; then
    #set -x
    cclass=${class[$ic]}
	if [[ -n "$cclass" ]] ; then
		tst=${cclass##com.hp.seeker.sdl.k2.K2SearcherEx}
		tst=${tst##com.hp.seeker.cs.service.}
		tst=${tst%%Test}
		echo "Testing ${cclass} writing to whyiu$tst" > $ii/whyiu$tst
		cat $ii/whyiu$tst >> $ii/whyiu
		export ANT_OPTS="-Dfile.encoding=UTF8 -Xms64m -Xmx1048m "
		ant.bat -Dcompile.done=true -Dsrc.test.conf=target/classes_iutest \
		  -Diutest.xml=testng-integration-unit-tests-class.xml \
		  -Dwls.hostname=$wls_hostname -Dwls.port=$wls_port \
		  -Dclass.name=${class[$ic]} iutest.selected.class 2>&1 | tee $ii/whyiu$tst | cat -v
		  cat $ii/whyiu$tst >> $ii/whyiu
		set +x
	fi
fi
(( ic = ic + 1 ))
done
echo Commented out G
